# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-compress-raw-bzip2
_pkgname=Compress-Raw-Bzip2
pkgver=2.201
pkgrel=0
pkgdesc="Perl low-level interface to bzip2 compression library"
url="https://metacpan.org/release/PMQS/Compress-Raw-Bzip2-$pkgver"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev"
source="https://cpan.metacpan.org/authors/id/P/PM/PMQS/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete

	# remove man pages already provided by perl-doc
	rm -rf "$pkgdir"/usr/share/man
}

sha512sums="
003f76be1b5204f417beafb9c05d1cbb900c512b36ad74fb8b995e634c3955649a61438b7056fd0bd2ec7860396e18b24faca7a18cd6be8fd9167c86227f8229  Compress-Raw-Bzip2-2.201.tar.gz
"
